bitkeeper revision 1.1159.1.40 (411b35dbH9xNYJhiWeq5taj0xdMP2w)
authormjw@wray-m-3.hpl.hp.com <mjw@wray-m-3.hpl.hp.com>
Thu, 12 Aug 2004 09:18:19 +0000 (09:18 +0000)
committermjw@wray-m-3.hpl.hp.com <mjw@wray-m-3.hpl.hp.com>
Thu, 12 Aug 2004 09:18:19 +0000 (09:18 +0000)
Stop libcurl using http_proxy.

tools/python/xen/xend/XendMigrate.py
tools/xfrd/xen_domain.c

index 5b10f4c358397204156750bae1856754d66702f7..cc248d427bbe61fb69bdcf1f16f0ee79ce55a89f 100644 (file)
@@ -389,8 +389,8 @@ class XendMigrate:
 
     def session_begin(self, info):
         self._add_session(info.xid, info)
-        mcf = XfrdClientFactory(info)
-        reactor.connectTCP('localhost', XFRD_PORT, mcf)
+        xcf = XfrdClientFactory(info)
+        reactor.connectTCP('localhost', XFRD_PORT, xcf)
         return info
     
     def migrate_begin(self, dom, host, port=XFRD_PORT):
@@ -401,6 +401,8 @@ class XendMigrate:
         @param port: destination port
         @return: deferred
         """
+        if host in ['localhost', '127.0.0.1']:
+            raise XendError('cannot migrate to localhost')
         # Check dom for existence, not migrating already.
         # Subscribe to migrate notifications (for updating).
         xid = self.nextid()
index 7125893998b7f44c890584fa83eca1ac0e6b3e74..27135b95ef40fbe4ac2a18832927b1f4772ceb07 100644 (file)
@@ -142,11 +142,19 @@ static int do_curl_global_init = 1;
 static CURL *curlinit(void){
     if(do_curl_global_init){
         do_curl_global_init = 0;
+        // Stop libcurl using the proxy. There's a curl option to
+        // set the proxy - but no option to defeat it.
+        unsetenv("http_proxy");
         curl_global_init(CURL_GLOBAL_ALL);
     }
     return curl_easy_init();
 }
 
+int curldebug(CURL *curl, curl_infotype ty, char *buf, size_t buf_n, void *data){
+    printf("%*s\n", buf_n, buf);
+    return 0;
+}
+
 /** Configure a new domain. Talk to xend using libcurl.
  */
 int xen_domain_configure(uint32_t dom, char *vmconfig, int vmconfig_n){
@@ -195,6 +203,8 @@ int xen_domain_configure(uint32_t dom, char *vmconfig, int vmconfig_n){
         eprintf("> Error adding op field.\n");
         goto exit;
     }
+    curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
+    curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, curldebug);
     // No progress meter.
     //curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1);
     // Completely quiet.